package com.heima.admin;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.heima.client.wemedia.IWmChannelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@EnableAsync   //开启Spring内置线程池，支撑方法异步调用
@ComponentScan(basePackages = {"com.heima.client", "com.heima.admin"})
@EnableFeignClients(clients = {IWmChannelClient.class})
public class AdminApplication {
    public static void main(String[] args) {
            SpringApplication.run(AdminApplication.class,args);
    }

    @Bean
    public MybatisPlusInterceptor adminMybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}
